#!/bin/bash

# get IP of current server. note: this may get more than one IPs
function myip()
{
    ip -f inet addr | grep inet | awk '{print $2}' | awk -F/ '{print $1}' | grep -v '127.0.0.1'
}

# echo some text with red color
function echoRed()
{
    echo -e "\e[1;31m$@\e[0m"
}

# echo some text with blue color
function echoBlue()
{
    echo -e "\e[1;34m$@\e[0m"
}

# echo some text with green color
function echoGreen()
{
    echo -e "\e[1;32m$@\e[0m"
}

# echo some text with yellow color
function echoYellow()
{
    echo -e "\e[1;33m\e[1;42m$@\e[0m"
}

# 执行ssh命令时不要弹出是否确认主机指纹的提示
function SSH_CMD()
{
    ssh -o StrictHostKeyChecking=no $@
}

# 执行scp命令时不要弹出是否确认主机指纹的提示
function SCP_CMD()
{
    scp -r -o StrictHostKeyChecking=no $@
}
